package com.scau.service.impl.business;

import java.io.Serializable;

import org.springframework.stereotype.Component;

import com.scau.exception.BusinessException;
import com.scau.model.business.ShoeWarehouse;
import com.scau.service.BaseService;

@Component
public class ShoeWarehouseService extends BaseService<ShoeWarehouse> implements Serializable{
	public void save(ShoeWarehouse s) throws BusinessException{
		if (null != s && null != s.getShoe_id()) {
			if(null != s.getId()&& 0 != s.getId()){// 检查仓库内是否已有该 shoe_id的鞋子
				update(s);
			}else{
				// 无，此时为新增鞋款	
				add(s);
			}
		}else {
			throw new BusinessException("冲单仓库鞋款 shoe_id 不能为空");
		}
	}
	/*public ShoeWarehouse get(ShoeWarehouse s){
		if (null != s && null != s.getShoe_id()) {
			if(null != s.getShoe_id()&& 0 != s.getShoe_id()){// 检查仓库内是否有相同 shoe_id的鞋子
				update(s);
			}else{
				add(s);
			}
		}
		return s;
	}*/
}
